package com.keepers.repair.fragment;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.keepers.repair.R;
import com.keepers.repair.activity.BaseActivity;
import com.keepers.repair.helper.IntentHelper;
import com.keepers.repair.view.TitleBar;

/**
 * auth aboom
 * date 2018/10/22
 */
public class SetFragment extends BaseFragment {

    private boolean isImmersiveStatusBar;

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (context instanceof BaseActivity) {
            this.isImmersiveStatusBar = ((BaseActivity) context).isImmersiveStatusBar;
        }
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = ff(R.layout.fragment_set);
        if (isImmersiveStatusBar) {
            f(view, R.id.status_bar).setVisibility(View.VISIBLE);
        }
        TitleBar titleBar = f(view, R.id.title_bar);
        titleBar.initializeHeaderNo("设置");
        f(view, R.id.layout_set_account).setOnClickListener(v -> IntentHelper.goAccountSetting(getActivity()));
        f(view,R.id.layout_net_setting).setOnClickListener(v -> IntentHelper.goNetSetting(getActivity()));
        return view;
    }
}
